﻿using System;
using System.IO;

namespace JLM2
{
    class JLMConfig
    {
        public readonly string ConfigParam;            // 串口号
        //public List<string> PortList { get; set; } = new List<string>(); // 端口列表
        public JLMConfig(string configFile)
        {
            if (File.Exists(configFile))
            {
                //byte[] buffer = new byte[32];
                try
                {
                    FileStream _configFile = new FileStream(configFile, FileMode.Open);
                    byte[] buffer = new byte[_configFile.Length];
                    _configFile.Read(buffer, 0, buffer.Length);
                    ConfigParam = System.Text.Encoding.ASCII.GetString(buffer);
                    //PortList = ConfigParam.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                    _configFile.Close();
                }
                catch (SystemException se)
                {

                }
            }
        }
    }
}